<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="/resource/UserPwoer.tld" prefix="p"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	pageContext.setAttribute("fnId", request.getAttribute("fnId"));
	pageContext.setAttribute("userPwoer", request.getSession().getAttribute("userPwoer"));
%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="../images/favicon.ico">
<!-- 本框架基本脚本和样式 -->
<script type="text/javascript"
	src="${path }/resource/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript"
	src="${path }/resource/js/systools/MBase.js"></script>
<style>
	.ibox-content{
	    	padding:50px 20px;
	    }
        .item{
            border: 1px solid #cccccc;
            text-align: center;
            width: 220px;
            height: 180px;
            margin: 10px auto;
            position: relative;
            overflow: hidden;
            font-family: "微软雅黑";
            border-radius:4px ;
            box-shadow: 3px 3px 10px rgb(149,149,149);
        }
        .item img{
            width: 100%;
            height: 100%;
            text-align: center;
        }
        .item .item-con{
            width: 100%;
            height: 40%;
            background: #ffffff;
            position: absolute;
            bottom:0;
            padding: 5px;
        }
        .item .item-con a{
            color: rgb(7,17,27);
            font-size: 16px;
            display: block;
        }
        .item .item-con .btn{
            height: 26px;
            line-height: 12px;
            margin-top: 5px;
        }    
</style>
</head>
<body class="gray-bg">
	<div class="ibox-content row">
    <div class="col-md-3">
        <div class="item">
            <img src="http://img.mukewang.com/57fdb282000186df06000338-240-135.jpg" alt="">
            <div class="item-con">
                <a href="http://10.0.0.7:9898/KFC/visitor/posts/toDetail?key=57" target="_blank">MatrixJava框架 第一讲</a>
                <button class="btn btn-primary " id="video1" onclick="answerQuestions1()" disabled>答题</button>
            </div>
        </div>
    </div>
    <div class="col-md-3">
        <div class="item">
            <img src="http://img.mukewang.com/57fdb282000186df06000338-240-135.jpg" alt="">
            <div class="item-con">
                <a href="http://10.0.0.7:9898/KFC/visitor/posts/toDetail?key=58" target="_blank">MatrixJava框架 第二讲</a>
                <button class="btn btn-primary " id="video2" onclick="answerQuestions2()" disabled>答题</button>
            </div>
        </div>
    </div>
    <div class="col-md-3">
        <div class="item">
            <img src="http://img.mukewang.com/57fdb282000186df06000338-240-135.jpg" alt="">
            <div class="item-con">
                <a href="http://10.0.0.7:9898/KFC/visitor/posts/toDetail?key=59" target="_blank">MatrixJava框架 第三讲</a>
                <button class="btn btn-primary " id="video3" onclick="answerQuestions3()" disabled>答题</button>
            </div>
        </div>
    </div>
    <div  class="col-md-3">
        <div class="item">
            <img src="http://img.mukewang.com/57fdb282000186df06000338-240-135.jpg" alt="">
            <div class="item-con">
                <a href="http://10.0.0.7:9898/KFC/visitor/posts/toDetail?key=61" target="_blank">MatrixJava框架 第四讲</a>
                <button class="btn btn-primary" id="video4" onclick="answerQuestions4()" disabled>答题</button>
            </div>
        </div>
    </div>

</div>
	
	<script type="text/javascript">
	/**
	 * 查询新手已经进行到哪个视频学习
	 */
	$(function() {
		 $.AjaxProxy().invoke(
				"${path}/admin/taskExecution/studentVideo",
				function(loj) {
						if(loj.getValue("info")=='暂未开始视频学习'){
							$("#video1").attr('disabled',false);
						}
						console.log(loj.getValue("rows")[0].status);
						if(loj.getValue("rows")[0].status=="3"){
							$("#video2").attr('disabled',false);
						}
						if(loj.getValue("rows")[0].status=="4"){
							$("#video3").attr('disabled',false);
						}
						if(loj.getValue("rows")[0].status=="5"){
							$("#video4").attr('disabled',false);
						}
			}); 
	})
		function answerQuestions1(){
			layer.full(layer.open({
				type : 2,
				title : "回答第一讲问题",
				area : [ MUI.SIZE_L, '400px' ],
				maxmin : true,
				content : [ '${path}/admin/redirect/answer-question3-list']
			}));
		}
		
		function answerQuestions2(){
			layer.full(layer.open({
				type : 2,
				title : "回答第二讲问题",
				area : [ MUI.SIZE_L, '400px' ],
				maxmin : true,
				content : [ '${path}/admin/redirect/answer-question4-list']
			}));
		}
		
		function answerQuestions3(){
			layer.full(layer.open({
				type : 2,
				title : "回答第三讲问题",
				area : [ MUI.SIZE_L, '400px' ],
				maxmin : true,
				content : [ '${path}/admin/redirect/answer-question5-list']
			}));
		}
		
		function answerQuestions4(){
			layer.full(layer.open({
				type : 2,
				title : "回答第四讲问题",
				area : [ MUI.SIZE_L, '400px' ],
				maxmin : true,
				content : [ '${path}/admin/redirect/answer-question6-list']
			}));
		}
		
	</script>
</body>
</html>
